// this is the file where you can manually set a
// time pattern and see its effect and result

#include <algorithm>
#include <functional>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cmath>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <complex>
#include <set>
#include <map>
#include <list>
#include <stack>
#include <queue>
#include <vector>
using namespace std;

short NUM_OF_SOLVERS; 
short NUM_OF_PROBLEMS;
double TIME_LIMIT;

vector<string> split(string& str, char sep ) {
	vector< string > ret;
	string::iterator from( str.begin() );
    int i = 0;
    while( true ) {
		string::iterator to = find( from, str.end(), sep );
        if( to == str.end() ) {
            string temp(from,to);
			ret.push_back( temp );
            break;
        } else {
			string temp(from,to);
            ret.push_back( temp );
            from = ++to;
        }
        i++;
    }
	return ret;
}

int main(){
    
    vector<int> solver;
    int cnt;
    double time;
    
    bool solved[3000];
    
    vector<string> solverNames;
    
    freopen("ga.in","r",stdin);freopen("tester_result.out","w",stdout);
    string solverName = "auto|blast|simp|fast|best|force|fastsimp|meson|metis";
    solverNames = split(solverName, '|');
    
    double solverTime[9] = {6.48,4.32,6.12,4.32,5.64,5.64,17.04,4.2,6.24};
    memset(solved,false,sizeof(solved));

    // Reading The Constants
    cin >> NUM_OF_SOLVERS; 
    cin >> NUM_OF_PROBLEMS;
    cin >> TIME_LIMIT;

    // Reading The Table
    for (int i = 0; i < NUM_OF_SOLVERS; i ++ ){
        for (int j = 0; j < NUM_OF_PROBLEMS; j ++ ){
            cin >> time;
            if ( solverTime[i] >= time ){
                solved[j] = true;            
            }
        }
    }
    
    cnt = 0;
    for (int i = 0; i < NUM_OF_PROBLEMS; i ++ )
        if (solved[i]) cnt ++;

    for (int i = 0 ; i < NUM_OF_SOLVERS; i ++ ){
        cout << solverNames[i] << ": " << solverTime[i] << endl;
    }

    cout << "Solved: " << cnt << endl;
}
